<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>测试fromEventPattern</title>
</head>
<body>
<button>click</button>
<script src="../node_modules/jquery/dist/jquery.js"></script>
<script src="../node_modules/rx/dist/rx.all.js"></script>
<script>

	function addClickHandler (handle) {
		document.addEventListener('click',handle,false);
	}
	function removeClickHandler (handle) {
		document.removeEventListener('click',handle,false);
	}
	let btn = document.getElementsByTagName('button')[0];
	let click$ = Rx.Observable.fromEventPattern(addClickHandler,removeClickHandler);
	
	click$.subscribe(e => console.log(e.target));
</script>
</body>
</html>